package com.woniuxy.member.client;


import com.woniuxy.member.client.param.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import result.Result;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "memberManageClient",name="member",path="member")
public interface MemberManageClient {

    @PostMapping("/loginStore")
    public Result loginStore(@RequestBody AddMemberParam addMemberParam);

    @PostMapping("/loginTable")
    public Result loginTable(@RequestBody AddMembersParam addMembersParam);

    @PutMapping("/exchangeFood")
    public Result exchangeFood(@RequestParam("exchangeFoodId") Integer exchangeFoodId);

    @PutMapping("/exchangeCoupon")
    public Result exchangeCoupon(@RequestParam("exchangeCouponId") Integer exchangeCouponId);

    @PostMapping(value = "/uploadState",headers = "content-type=multipart/form-data")
    Result uploadState(@RequestBody MultipartFile[] files) throws IOException;

    @PostMapping("/addMemberFood")
    public Result addMemberFood(@RequestBody AddMemberFoodParam addMemberFoodParam);

    @PostMapping("/addMemberCoupon")
    public Result addMemberCoupon(@RequestBody AddMemberCouponParam addMemberCouponParam);

    @PutMapping("/modifyMemberFood")
    public Result modifyMemberFood(@RequestBody ModifyMemberFoodParam modifyMemberFoodParam);

    @PutMapping("/modifyMemberCoupon")
    public Result modifyMemberCoupon(@RequestBody ModifyMemberCouponParam modifyMemberCouponParam);

    @DeleteMapping("/delMemberFood")
    public Result delMemberFood(@RequestParam("storeId")Integer storeId,@RequestParam("exchangeFoodId")Integer exchangeFoodId);

    @DeleteMapping("/delMemberCoupon")
    public Result delMemberCoupon(@RequestParam("storeId")Integer storeId,@RequestParam("exchangeCouponId")Integer exchangeCouponId);
}
